import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import fs from 'fs'
import path from 'path'
import cesium from 'vite-plugin-cesium'; // 引入插件

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(),cesium({
    rebuildCesium: true
  })],
  server: {
    // https: {
    //   cert: fs.readFileSync(path.join(__dirname, "keys/cert.crt")),
    //   key: fs.readFileSync(path.join(__dirname, "keys/cert.key")),
    // },
    proxy: {
      '/sockety': {
        target: 'wss://192.168.3.12:8888',
        ws: true,
        changeOrigin: true
      },
      "/cesium-api": {
        target: 'https://cesium.vip',
        changeOrigin: true
      },
      "/liumeiti": {
        target: "http://m.ovmeet.com",
        changeOrigin: true
      },
    },
  },
})
